package Homework7;

public class Person3 extends Person0 implements Comparable<Person3> {
    public Person3(String n, int a) {
        super(n, a);
    }

    @Override
    public int compareTo(Person3 other) {
        int ageCompare = Integer.compare(this.getAge(), other.getAge());
        if (ageCompare != 0) {
            return ageCompare;
        }
        return this.getName().compareTo(other.getName());
    }
}
